<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateProductsTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		//
		Schema::create('products', function($table)
		{
			$table->increments('id');
			$table->string('code', 255);
			$table->tinyInteger('parent_id');
			$table->tinyInteger('category_id');
			$table->string('name_en', 255);
			$table->string('name_vi', 255);
			$table->tinyInteger('media_id')->nullable();
			$table->string('madein', 255)->nullable();
            $table->double('price_original')->nullable();
			$table->double('price_sale')->nullable();
			$table->string('size', 255)->nullable();
            $table->float('weight')->nullable();
			$table->string('color', 255)->nullable();
			$table->string('material', 255)->nullable();
			$table->string('description_en', 1024)->nullable();
			$table->string('description_vi', 1024)->nullable();
			$table->string('note_en', 255)->nullable();
            $table->string('note_vi', 255)->nullable();
			$table->timestamps();
			$table->tinyInteger('status');
			$table->tinyInteger('is_deleted');
		});
	}

	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		//
		Schema::drop('products');
	}

}
